'\" te
.\" Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DOOR_CRED 3C "Mar 22, 2005"
.SH NAME
door_cred \- return credential information associated with the client
.SH SYNOPSIS
.LP
.nf
\fBcc\fR \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
#include <door.h>

\fBint\fR \fBdoor_cred\fR(\fBdoor_cred_t *\fR\fIinfo\fR);
.fi

.SH DESCRIPTION
.LP
The \fBdoor_cred()\fR function returns credential information associated with
the client (if any) of the current door invocation.
.sp
.LP
The contents of the \fIinfo\fR argument include the following fields:
.sp
.in +2
.nf
uid_t   dc_euid;        /* Effective uid of client */
gid_t   dc_egid;        /* Effective gid of client */
uid_t   dc_ruid;        /* Real uid of client */
gid_t   dc_rgid;        /* Real gid of client */
pid_t   dc_pid;         /* pid of client */
.fi
.in -2

.sp
.LP
The credential information associated with the client refers to the information
from the immediate caller; not necessarily from the first thread in a chain of
door calls.
.SH RETURN VALUES
.LP
Upon successful completion, \fBdoor_cred()\fR returns \fB0\fR. Otherwise,
\fBdoor_cred()\fR returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the
error.
.SH ERRORS
.LP
The \fBdoor_cred()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBEFAULT\fR\fR
.ad
.RS 10n
The address of the \fIinfo\fR argument is invalid.
.RE

.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
There is no associated door client.
.RE

.SH USAGE
.LP
The \fBdoor_cred()\fR function is obsolete. Applications should use the
\fBdoor_ucred\fR(3C) function in place of \fBdoor_cred()\fR.
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Architecture	all
_
Interface Stability	Obsolete
_
MT-Level	Safe
.TE

.SH SEE ALSO
.LP
.BR door_call (3C),
.BR door_create (3C),
.BR door_ucred (3C),
.BR attributes (7)
